import {createRouter, createWebHashHistory} from "vue-router";

const routes = [
    {
        path: '/',
        redirect:'/home/homePage'
    },
    {
        path: "/welcome",
        component:()=>import("@/views/welcome.vue"),
        children:[
            {
                path: "login",
                name: "login",
                component:()=>import("@/views/login.vue")
            },
            {
                path: "register",
                name: "register",
                component:()=>import("@/views/register.vue")
            }
        ]
    },
    {
        path: "/home",
        name: "home",
        component:()=>import("@/views/home.vue"),
        children: [
            {
                path:"homePage",
                name:"homePage",
                component:()=>import("@/views/page/homePage.vue")
            },
            {
                path:"history",
                name:"history",
                component:()=>import("@/views/page/history.vue")
            },
            {
                path:"myVideo",
                name:"myVideo",
                component:()=>import("@/views/page/myVideo.vue")
            },
            {
                path:"laterWatch",
                name:"laterWatch",
                component:()=>import("@/views/page/laterWatch.vue")
            },
            {
                path:"collection",
                name:"collection",
                component:()=>import("@/views/page/collection.vue")
            },
            {
                path: "upload",
                name: "upload",
                component: () => import("@/views/page/upload.vue")
            },
            {
                path: "frame",
                name: "frame",
                component: ()=>import("@/views/page/frame.vue")
            },
            {
                path: "videoPlay",
                name: "videoPlay",
                component: ()=>import("@/views/page/videoPlay.vue"),
                props: {
                    query:{

                    }
                }
            }
        ]
    }
]

const router = createRouter({
    history:createWebHashHistory(),
    routes
})

export default router;
